import request from '@/utils/request.js'

// 获取角色列表
export const getRoleListService = () => {
    return request.get('/role/list')
}

// 添加角色
export const addRoleService = (roleData) => {
    return request.post('/role/add', roleData)
}

// 更新角色
export const updateRoleService = (roleData) => {
    return request.put('/role/update', roleData)
}

// 删除角色
export const deleteRoleService = (roleId) => {
    return request.delete(`/role/delete/${roleId}`)
}

// 获取角色权限
export const getRolePermissionsService = (roleId) => {
    return request.get(`/role/permissions/${roleId}`)
}

// 更新角色权限
export const updateRolePermissionsService = (roleId, permissions) => {
    return request.put(`/role/permissions/${roleId}`, { permissions })
} 